from tkinter import *

root=Tk()

sb=Scrollbar(root)
sb.pack(side=RIGHT,fill=Y)

thelb=Listbox(root,yscrollcommand=sb.set,selectmode=SINGLE)
thelb.pack(side=LEFT,fill=BOTH)

for i in range(100):
    thelb.insert(END,i)

sb.config(command=thelb.yview)


mainloop()
